package com.project.lk.nurseapp.sphy.presenter;

import com.project.lk.nurseapp.base.BaseApi;
import com.project.lk.nurseapp.base.BasePresenter;
import com.project.lk.nurseapp.base.ModelPresenterBridge;
import com.project.lk.nurseapp.sphy.model.PostSphyModel;

import java.util.List;

/**
 * 功能介绍：
 * 项目名：
 * 模块名称：
 * 作者：LK
 * 日期：2018/1/9
 * 修改日期：
 */
public class PostSphyPresenter extends BasePresenter<IPostSphyView> implements ModelPresenterBridge {

    PostSphyModel postSphyModel;
    public PostSphyPresenter(IPostSphyView view){
        postSphyModel=new PostSphyModel();
        postSphyModel.setBridge(this);
        addView(view);
    }
    public void postSphtDate(String url, String shirk, String diastole,String pulse,String testTesult, String recordTime){
        postSphyModel.postLoadJson(url,shirk,diastole,pulse,testTesult,recordTime);
    }

    @Override
    public void bridge(int action, List list) {

        if (view!=null) {
            switch (action){
                case BaseApi.post_sphy_success:
                    view.postSuccess();
                    break;
                case BaseApi.post_sphy_fail:
                    view.postFail();
                    break;
            }
        }
    }
}
